<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ACCOUNT_INFO command Example :: Master-Unlock API</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" />
</head>

<body>
<h1>ACCOUNT_INFO</h1>
<?php
	/* Include the library */
	require('../library/api.php');
	/* Call the API */	
	$xml = MasterUnlock::CallAPI ('ACCOUNT_INFO');
	if (is_string ($xml)){
		/* Parse the XML stream */
		$data = MasterUnlock::ParseXML($xml);
		
		if (is_array ($data)) {
			if (isset ($data['ERROR_MESSAGE'])) {
				/* The API has returned an error */
				print ('API error : ' . htmlspecialchars ($data['ERROR_MESSAGE']));
			} else {
				/* Everything works fine */
				printf ('Account email : <b>%s</b>', htmlspecialchars ($data['EMAIL']));
				printf ('<br />');
				printf ('Credits available : <b>%s</b>', htmlspecialchars ($data['CREDITS']));
				printf ('<br />');
				printf ('Account Currency : <b>%s</b>', htmlspecialchars ($data['CURRENCY']));
				printf ('<br />');
				printf ('Account Language : <b>%s</b>', htmlspecialchars ($data['LANGUAGE']));
			}
		} else {
			/* Parsing error */
			print('Could not parse the XML stream');
		}
	} else	{
		/* Communication error */
		print('Could not communicate with the api');
	}
?>
<p><a href="./">Go back</a></p>
</body>
</html>